<cfif isdefined('form.selfiles')>
<cfsetting requesttimeout="1000">
<cfparam name="dir" default="/">
<cfparam name="tofolder" default="/">
<cfset frompath = "#request.adminpath##dir#">
<cfset topath = "#request.adminpath##tofolder#">
<cfset frompath = replace(frompath, "//", "/", "ALL")>
<cfset topath = replace(topath, "//", "/", "ALL")>
<h3>Copying Files</h3>
<cfloop list="#form.selfiles#" delimiters="," index="f">
	<cfif fileexists('#frompath##f#') AND directoryexists('#topath#')>
		<cffile action="copy" source="#frompath##f#" destination="#topath##f#" mode="777" nameconflict="overwrite">
    </cfif>
</cfloop>
<cfinvoke component="cfcs.common.shared" method="redirect" url="index.cfm?c=adminfilemanager&dir=#tofolder#" msg="Files Copied Successfully." />
<cfelse>
<cflocation url="index.cfm?c=adminfilemanager&dir=#dir#">
</cfif>